Quits and saves the input